﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CrossLayerCommunication;

namespace UnitTest
{
    public static class MessageHelper
    {
        public static IMessage CreateOrGetMessage(int id, string key = null, MessageType type = MessageType.Error, params object[] arguments)
        {
            IMessage message = null;
            if (CrossLayerCommunication.Message.TryGetMessageById(id, out message))
                return message;

            return CrossLayerCommunication.Message.Create(id, key, type, arguments);
        }
    }
}
